This is Rick,so sorry to reply you delay.
You need to redirect the output stream,so that you can capturing the result via script.
For example:
#! /bin/bash
asterisk -rx 'gsm show spans'>test.txt
cat test.txt|while read line
do
echo $line
done
I guess you want write a program send AT,please give me your e-mail.I can give you some document.
My contaxt info be shown as below:
Gtalk: This email address is being protected from spambots. You need JavaScript enabled to view it.
Skype: rick.zhu3
e-mail: This email address is being protected from spambots. You need JavaScript enabled to view it.
the file was empty; there seemed to have been no response from the AT command, exactly as if I had left the output to STDOUT. So redirecting the output to a file seems not to be enough, by itself, to capture the AT command output.
To make it absolutely clear, it's the IMSI (serial number of the SIM) that I am really interested in -- the intention is that a bunch of SIMs will be rotated through the machine, with each one being used until its message allowance is used up. I want the IMSI so I can keep track of how many messages have been sent using each SIM, irrespective of which slot on the card it was inserted. The corrupt `gsm show span n` output probably is a separate issue.
I am unable to use Skype due to company policy against closed source software. However, I can be reached on Google Talk as This email address is being protected from spambots. You need JavaScript enabled to view it. . I can also be contacted by e-mail at the address I originally used to register with the forum.